﻿using System;
using SilverCrmSoap.CrmSdk;

namespace SilverCrmSoap.Helpers
{
    public class SoapAsyncState
    {
        public IOrganizationService Client { get; set; }
        public string Id { get; set; }
        public object Data { get; set; }

        public SoapAsyncState()
        {
            Client = SoapHelper.SoapClient;
            Id = Guid.NewGuid().ToString();
        }
        
        public SoapAsyncState(string id)
        {
            Client = SoapHelper.SoapClient;
            Id = id;
        }

        public SoapAsyncState(string id, object data)
        {
            Client = SoapHelper.SoapClient;
            Id = id;
            Data = data;
        }

        public SoapAsyncState(IOrganizationService client)
        {
            Client = client;
            Id = Guid.NewGuid().ToString();
        }

        public SoapAsyncState(IOrganizationService client, string id)
        {
            Client = client;
            Id = id;
        }

        public SoapAsyncState(IOrganizationService client, string id, object data)
        {
            Client = client;
            Id = id;
            Data = data;
        }
    }
}
